﻿/*********************弘石项目三组************************
*  功能描述：系统设置-菜单
*  作者：黄启轩
*  时间：2020-12-18
*  修改人：黄启轩
*  修改时间：2020-12-18
*********************弘石项目三组************************/
using Hong.IRepository.IRepository_SystemSettings.RBAC;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace WeHongshibApI.Controllers.Controllers_SystemSettings.RBAC
{
    [ApiExplorerSettings(GroupName = "SystemSettings")]
    [Route("api/[controller]")]
    [ApiController]
    public class MenudController : ControllerBase
    {
        #region 构造器API注入
        private readonly Imenud _Imenud;
        public MenudController(Imenud Imenud)
        {
            _Imenud = Imenud;
        }

        #endregion

        [HttpGet,Route("getmenus")]
        public IActionResult getmenus(string? Uid)
        {
            return Ok(_Imenud.getmenus(Uid));
        }

        [HttpPost, Route("AddRM")]
        public IActionResult AddRM(string RoleId, string Mid)
        {
            return Ok(_Imenud.AddRM(RoleId, Mid));
        }

        [HttpGet, Route("getmenusAll")]
        public IActionResult getmenusAll()
        {
            return Ok(_Imenud.getmenusAll());
        }

        [HttpGet, Route("getRM")]
        public IActionResult getRM(string RoleId)
        {
            return Ok(_Imenud.getRM(RoleId));
        }
    }
}
